package com.lagou.demo.rpc;

import com.lagou.demo.SimpleOrderManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.TimeUnit;

@RestController
@RequestMapping("email")
public class EmailRpcEndpoint {

    @Autowired
    private SimpleOrderManager simpleOrderManager ;

    @RequestMapping("/{email}/{code}")
    public Boolean sendEmail(@PathVariable("email") String sendTo, @PathVariable("code") String content) {
        return simpleOrderManager.sendEmail(sendTo, content);
    }

}
